from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    # 1定位方法XPATH
    def k(self):
        ele=(By.XPATH,'//android.widget.TextView[@text="搜索菜谱"]')
        loc=self.find_ele(ele)
        return loc
    # 2定位方法CLASS_NAME
    def k2(self):
        ele = (By.CLASS_NAME, 'android.widget.EditText')
        loc = self.find_ele(ele)
        return loc
    # 3定位方法ANDROID_UIAUTOMATOR
    def aniu(self):
        ele = (By.ANDROID_UIAUTOMATOR, 'new UiSelector().text("搜索")')
        loc = self.find_ele(ele)
        return loc
    # 4定位方法ACCESSIBILITY_ID
    def qk(self):
        ele = (By.ACCESSIBILITY_ID, '清空搜索内容')
        loc = self.find_ele(ele)
        return loc
    # 5定位方法ID
    def fh(self):
        ele = (By.ID, 'com.xiachufang:id/navigation_img_view')
        loc = self.find_ele(ele)
        return loc
    # 断言评分最高

    def duanyan(self):
        ele = (By.XPATH, '//android.widget.TextView[@text="评分最高"]')
        loc = self.find_ele(ele)
        return loc